package ModelLayer;

/**
 * Write a description of class Loan here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Loan
{
    private String id;
    private String name;
    private String borrowDate;
    private String returnDate;
    private String period;
    private String state;
    private Copy loanedCopy;
    private String title;

    /**
     * Constructor for objects of class Loan
     */
    public Loan(String id, String borrowDate, String period, String serialNo, String purchaseDate, String purchasePrice, String name, String title)
    {
        this.id = id;
        this.name = name;
        loanedCopy = new Copy(serialNo, purchaseDate, purchasePrice);
        this.borrowDate = borrowDate;
        this.period = period;
        this.state = "on loan";
        this.title = title;
        returnDate = null;
    }

    public Loan()
    {
    }

    public String getId()
    {
        return id;
    }

    public String getName()
    {
        return name;
    }

    public String getBorrowDate()
    {
        return borrowDate;
    }

    public String getReturnDate()
    {
        return returnDate;
    }

    public String getPeriod()
    {
        return period;
    }

    public String getState()
    {
        return state;
    }

    public void setId(String id)
    {
        this.id = id;
    }

    public void setBorrowDate(String borrowDate)
    {
        this.borrowDate = borrowDate;
    }

    public void setReturnDate(String returnDate)
    {
        this.returnDate = returnDate;
    }

    public void setPeriod(String period)
    {
        this.period = period;
    }

    public void setState(String state)
    {
        this.state = state;
    }

    public String getSerialNumber()
    {
        return loanedCopy.getSerialNumber();
    }

    public String getPurchaseDate()
    {
        return loanedCopy.getPurchaseDate();
    }

    public String getPurchasePrice()
    {
        return loanedCopy.getPurchasePrice();
    }

    public String getTitle()
    {
        return title;
    }
}